package com.cheetah.start.common.config.property;

import com.cheetah.start.common.constant.CommonConst;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 上传地址前缀
 *
 * @author xjhmwj
 * @date 2021/6/11 17:32
 */
@Data
@Component
@ConfigurationProperties("upload")
public class UpLoadProprety {


    /**
     * 文件存放路径前缀
     */
    private String path;

    /**
     * window 文件显示路径
     */
    private String host;

    /**
     * 备份路径
     */
    private String back;

    /**
     * 根据系统获取路径前面部分
     *
     * @return {@link String}
     */
    public String getPath() {
        return path;
    }

    public String getProfileHost() {
        return host + CommonConst.RESOURCE_PREFIX_INCLUDE;
    }
}
